home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 13174 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.3 KB

  1. Path: lrz-muenchen.de!news
  2. From: watzka@stat.uni-muenchen.de (Kurt Watzka)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Storing C Functions In An Array?
  5. Date: 4 Apr 1996 20:21:17 GMT
  6. Organization: Leibniz-Rechenzentrum, Muenchen (Germany)
  7. Distribution: world
  8. Message-ID: <4k1avt$b58@sparcserver.lrz-muenchen.de>
  9. References: <4jc1u7$5e9@infa.central.susx.ac.uk> <4jerhn$sc8@oege.htsa.hva.nl> <4jj5d0$me8@news.xs4all.nl> <4k12qc$epc@oege.htsa.hva.nl>
  10. NNTP-Posting-Host: sun2.lrz-muenchen.de
  11.  
  12. ferdinan@htsa.htsa.hva.nl (Ferdinand de Boevere) writes:
  13.  
  14. >In article <4jj5d0$me8@news.xs4all.nl>, Falstaff <falstaff@xs4all.nl> wrote:
  15. >>ferdinan@htsa.htsa.hva.nl (Ferdinand de Boevere) writes:
  16.  
  17. >>I remember one entry in an early Obfuscated C Programming Contest.
  18. >>It declared main something like this:
  19.  
  20. >>int main[]=
  21. >>{  5236,736,8,-547,'f', 
  22.  
  23. >>and it actually ran on PDPs and VAXen.  So it *can* be done :-)
  24.  
  25. >No, it can't be done !
  26. >This was probably nothing but declaring an array called main
  27. >inside another function (e.g. main).
  28.  
  29. The trick is _not_ do declare this array inside another function, i.e.,
  30. you _want_ to have a symbol called "_main" with external linkage. It
  31. might be less than portable, though :-)
  32.  
  33. Kurt
  34. -- 
  35. | Kurt Watzka                             Phone : +49-89-2180-6254
  36. | watzka@stat.uni-muenchen.de
  37.  
  38.